-model_name = controller_name.singularize
-model_title = controller_name.singularize.titleize
-instance = instance_variable_get("@" + model_name)
-content_for :widget_title do
  Risks associated with this Attribute

-content_for :widget_help, "#{model_name}_main"

-content_for :widget_id, "#{model_name}_main_widget"

-content_for :widget_buttons do
  .filter
    .row-fluid
      .span12
        .pull-right
          %a.widgetbtn.btn.btn-add{ :href => list_edit_flow_risk_risky_attributes_path(:risky_attribute_id => risky_attribute.id), :'data-toggle' => 'modal-ajax-relationship-selector', :'data-modal-reset' => 'reset', :'data-list-target' => 'refresh', :rel => 'tooltip', :'data-placement' => 'left', :title => 'Link risks to this attribute', :'data-modal-class' => 'modal-wide' }
            %i.grcicon-link-white
            Risk

.action-items
  %a.expandAll.btn.btn-mini{:href => "#", :rel => "tooltip", :title => "Expand all"}
    %i.grcicon-wide-black
  %a.shrinkAll.btn.btn-mini{:href => "#", :rel => "tooltip", :title => "Collapse all"}
    %i.grcicon-normal-black

%ul.tree-structure
  -risks.each_with_index do |risk, i|
    -id_prefix = "risk-#{i}"
    -summary_toggle_target = "#{id_prefix}-summary"

    %li{ :class => risk.class.name.downcase}
      .item-main
        .openclose{ :class => 'lastchild' }
        .item-title
          .row-fluid
            =render :partial => 'object_leaf', :locals => { :instance => risk }
          .item-actions
            %a.btn.btn-mini.halfopacity{ "rel" => "tooltip", "data-placement" => "left", "title" => "Go to this object's page", :href => flow_risk_path(risk.id) }
              %i.grcicon-goto
